<template>
  <div
    class="home"
    id="home"
  >
    <z-header :selectNumber="selectNumber"></z-header>
    <z-navigation :numId="bannerId"></z-navigation>
    <z-information></z-information>
    <z-cooperation :caseList="caseList"></z-cooperation>
    <z-news :newsList="newsList"></z-news>
    <z-introduce></z-introduce>
    <z-footer></z-footer>
  </div>
</template>
<script>
import ZHeader from '../pages/header';
import ZNavigation from '../pages/navigation';
import ZIntroduce from '../pages/introduce';
import ZInformation from '../pages/information';
import ZCooperation from '../pages/cooperation';
import ZNews from '../pages/news';
import ZFooter from '../pages/footer'
export default {
  components: { ZHeader, ZNavigation, ZIntroduce, ZInformation, ZCooperation, ZNews, ZFooter },
  data() {
    return {
      selectNumber: '1',
      bannerList: [],
      caseList: [],
      newsList: {},
      bannerId: 1
    }
  },
  methods: {
    getHomeData() {
      this.axios
        .get("/web/home/index", {
          headers: {
            Authorization: "application",

          }
        })
        .then(response => {
          console.log(response);
          this.bannerList = response.data.data.bannerList;
          this.caseList = response.data.data.caseList;
          this.newsList = response.data.data.newsList;
          console.log(this.bannerList);
        })
        .catch(response => {
          console.log(response);
        });
    }
  },
  created() {
    this.getHomeData();
  },
  mounted() {
    document.body.scrollTop = 0;
    document.documentElement.scrollTop = 0;
  }
};
</script>
<style scoped lang="scss">
.home {
  width: 100%;
  position: absolute;
  background-color: #fff;
}
</style>
